<?php
require_once("conf/db_connection.php");

$trip_id = $_GET["id"];
$return_str = "";

$query_trip = "SELECT * FROM trip_detail WHERE id='".$trip_id."'";
$result_trip = mysql_query($query_trip) or die("SELECT TRIP DETAIL ".mysql_error());
$row_trip = mysql_fetch_array($result_trip);



$return_str = "<table id='pop_table' border='0' style='margin:25px 25px 0px 25px; padding: 0px auto;width:950px;height:250px;background-color:#FFFFFF;'>
<thead style='height:15%;'>
<tr id='hor-minimalist-b'>
	<th colspan='8'>".$row_trip['tas_number']."&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;Booking #".$row_trip['booking_number']."</th>
</tr>
</thead>
<tbody>
<tr>
	<td class='label'>Status</td>
	<td class='td_input'><input readonly='readonly' id='txt_status' name='txt_status' type='text' value='".strtoupper($row_trip['status'])."' /></td>
	<td class='label'>Source</td>
	<td class='td_input'><input readonly='readonly' id='txt_source' name='txt_source' type='text' value='".$row_trip['booking_source']."' /></td>
	<td class='label'>Quantity</td>
	<td class='td_input'><input readonly='readonly' id='txt_qty' name='txt_qty' type='text' value='".$row_trip['quantity']."' /></td>
	<td class='label'>Size</td>
	<td class='td_input'><input readonly='readonly' id='txt_size' name='txt_size' type='text' value='".$row_trip['container_size']."FTR' /></td>
</tr>
<tr>
	<td class='label'>Vessel<br />Voyage</td>
	<td class='td_input'><input readonly='readonly' id='txt_voyage' name='txt_voyage' type='text' value='".$row_trip['vessel_voyage']."' /></td>
	<td class='label'>Vessel<br />Voyage ETD</td>
	<td class='td_input'><input readonly='readonly' id='txt_voyage_etd' name='txt_voyage_etd' type='text' value='".$row_trip['vessel_voyage_etd']."' /></td>
	<td class='label'>Pickup<br />Date</td>
	<td class='td_input'><input readonly='readonly' id='txt_pick_date' name='txt_pick_date' type='text' value='".$row_trip['positioning_date']."' /></td>
	<td class='label'>Pickup<br />Time</td>
	<td class='td_input'><input readonly='readonly' id='txt_pick_time' name='txt_pick_time' type='text' value='".$row_trip['positioning_time']."' /></td>
</tr>
<tr>
	<td class='label'>Shipper<br />Name</td>
	<td class='td_input' colspan='3'><input readonly='readonly' id='txt_shipper' name='txt_shipper' type='text' style='width:98%;' value='".$row_trip['customer']."' /></td>
	<td class='label'>Shipper<br />Code</td>
	<td class='td_input'><input readonly='readonly' id='txt_shipper_code' name='txt_shipper_code' type='text' value='".$row_trip['shipper_code']."' /></td>	
	<td class='label'>Commodity<br />Class</td>
	<td class='td_input'><input readonly='readonly' id='txt_class' name='txt_class' type='text' value='".$row_trip['commodity_type']."' /></td>	
</tr>
<tr>	
	<td class='label'>Pickup<br />Address</td>
	<td class='td_input' colspan='3'><textarea readonly='readonly' id='txt_pick_add' name='txt_pick_add' cols='40' rows='1' style='width:98%;'>".$row_trip['pick_address']."</textarea></td>
	<td class='label'>Contact<br />Person</td>	
	<td class='td_input'><input readonly='readonly' id='txt_con_person' name='txt_con_person' type='text' value='".$row_trip['contact_person']."' /></td>
	<td class='label'>Contact #</td>
	<td class='td_input'><input readonly='readonly' id='txt_con_num' name='txt_con_num' type='text' value='".$row_trip['contact_number']."' /></td>	
</tr>
<tr>
	<td class='label'>Special<br />Instructions</td>
	<td class='td_input' colspan='3'><textarea readonly='readonly' id='txt_instruction' name='txt_instruction' cols='40' rows='1' style='width:98%;'>".$row_trip['instruction']."</textarea></td>
	<td class='label'>Type</td>
	<td class='td_input'><input readonly='readonly' id='txt_type' name='txt_type' type='text' value='".$row_trip['type']."' /></td>	
</tr>
</tbody>
</table>";

$return_str .= "<table id='pop_table' border='0' style='margin:0px 25px 25px 25px; padding: 0px auto;width:950px;height:150px;background-color:#FFFFFF;'>
<thead style='height:2%;'>
<tr id='hor-minimalist-b'>
	<th colspan='8'>Trucker Assignment</th>
</tr>
</thead>
<tbody>
<tr>
	<td class='label tflabel'>Truck</td>
	<td class='td_input'><input readonly='readonly' id='txt_truck' name='txt_truck' type='text' /></td>	
	<td class='label tflabel'>Size</td>
	<td class='td_input'><input readonly='readonly' id='txt_esizetype' name='txt_esizetype' type='text' /></td>	
</tr>
<tr>
	<td class='label tflabel'>Contact<br />Person</td>
	<td class='td_input'><input readonly='readonly' id='txt_contact_person' name='txt_contact_person' type='text' /></td>		
	<td class='label tflabel'>Contact<br />Number</td>
	<td class='td_input'><input readonly='readonly' id='txt_contact_num' name='txt_contact_num' type='text' /></td>	
</tr>
<tr>
	<td class='label tflabel'>Send SMS to:</td>
	<td class='td_input'><input id='txt_sms_to' name='txt_sms_to' type='text' /></td>	
</tr>
<tr>
	<td style='text-align:right;' colspan='2'><input onClick='confirmAssignment()'style='width:auto;' type='button' value='Submit' /></td>
	<td style='text-align:left;' colspan='2'><input onClick='closePopDiv()' style='width:auto;' type='button' value='Close' /></td>
</tr>
</tbody>
</table>
<input id='hf_truck_id' name='hf_truck_id' type='hidden' />
<input id='hf_assign_trip_id' name='hf_assign_trip_id' type='hidden' value='".$trip_id."' />
<input id='hf_raw_size' name='hf_raw_size' type='hidden' value='".$row_trip['container_size']."' />";
echo $return_str;
?>